﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Events.ascx.vb" Inherits="Events" %>
<asp:ListView ID="ListView1" runat="server" DataSourceID="AccessDataSource1">
    <AlternatingItemTemplate>
        <span class="eventTitle">
        <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></span>
        <br />
        Description:
        <asp:Label ID="DescriptionLabel" runat="server" 
            Text='<%# Eval("Description") %>' />
        <br />
        StartDate:
        <asp:Label ID="StartDateLabel" runat="server" Text='<%# Eval("StartDate") %>' />
        <br />
        EndDate:
        <asp:Label ID="EndDateLabel" runat="server" Text='<%# Eval("EndDate") %>' />
        <br />
<br />
    </AlternatingItemTemplate>
    <EditItemTemplate>
        <span class="eventTitle">
        <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /></span>
        <br />
        Description:
        <asp:TextBox ID="DescriptionTextBox" runat="server" 
            Text='<%# Bind("Description") %>' />
        <br />
        StartDate:
        <asp:TextBox ID="StartDateTextBox" runat="server" 
            Text='<%# Bind("StartDate") %>' />
        <br />
        EndDate:
        <asp:TextBox ID="EndDateTextBox" runat="server" Text='<%# Bind("EndDate") %>' />
        <br />
        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
            Text="Update" />
        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
            Text="Cancel" />
        <br /><br /></span>
    </EditItemTemplate>
    <EmptyDataTemplate>
        <span>No Events Posted</span>
    </EmptyDataTemplate>
    <InsertItemTemplate>
        <span style="">Title:
        <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
        <br />Description:
        <asp:TextBox ID="DescriptionTextBox" runat="server" 
            Text='<%# Bind("Description") %>' />
        <br />StartDate:
        <asp:TextBox ID="StartDateTextBox" runat="server" 
            Text='<%# Bind("StartDate") %>' />
        <br />EndDate:
        <asp:TextBox ID="EndDateTextBox" runat="server" Text='<%# Bind("EndDate") %>' />
        <br />
        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
            Text="Insert" />
        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
            Text="Clear" />
        <br /><br /></span>
    </InsertItemTemplate>
    <ItemTemplate>
        <div style="background-color: #ffe4f0 ">
        <span class="eventTitle">
        <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></span>
        <br />
        Description:
        <asp:Label ID="DescriptionLabel" runat="server" 
            Text='<%# Eval("Description") %>' />
        <br />
        StartDate:
        <asp:Label ID="StartDateLabel" runat="server" Text='<%# Eval("StartDate") %>' />
        <br />
        EndDate:
        <asp:Label ID="EndDateLabel" runat="server" Text='<%# Eval("EndDate") %>' />
        <br />
        </div>
<br /></span>
    </ItemTemplate>
    <LayoutTemplate>
        <div ID="itemPlaceholderContainer" runat="server" 
            style="font-family: Verdana, Arial, Helvetica, sans-serif;">
            <span runat="server" id="itemPlaceholder" />
        </div>
        <div style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF;">
        </div>
    </LayoutTemplate>
    <SelectedItemTemplate>
        <span style="background-color: #E2DED6;font-weight: bold;color: #333333;">Title:
        <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
        <br />
        Description:
        <asp:Label ID="DescriptionLabel" runat="server" 
            Text='<%# Eval("Description") %>' />
        <br />
        StartDate:
        <asp:Label ID="StartDateLabel" runat="server" Text='<%# Eval("StartDate") %>' />
        <br />
        EndDate:
        <asp:Label ID="EndDateLabel" runat="server" Text='<%# Eval("EndDate") %>' />
        <br />
<br /></span>
    </SelectedItemTemplate>
</asp:ListView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" 
    DataFile="~/App_Data/GotPink.accdb" 
    SelectCommand="SELECT [Title], [Description], [StartDate], [EndDate] FROM [Events]">
</asp:AccessDataSource>

